package model

import (
	"gorm.io/gorm"
	"time"
)

type TestPaper struct {
	Id             uint           `gorm:"column:id;type:bigint UNSIGNED;primaryKey;not null;" json:"id"`
	GroupPaperType uint           `gorm:"column:group_paper_type;type:tinyint(1);comment:1 手动组卷 2自动组卷;not null;" json:"group_paper_type"` // 1 手动组卷 2自动组卷
	ExName         string         `gorm:"column:ex_name;type:varchar(50);not null;" json:"ex_name"`
	ExType         uint           `gorm:"column:ex_type;type:tinyint(1);comment:1练习 2考试;not null;" json:"ex_type"` // 1练习 2考试
	ExTime         string         `gorm:"column:ex_time;type:varchar(255);not null;" json:"ex_time"`
	ExSort         uint           `gorm:"column:ex_sort;type:tinyint(1);not null;" json:"ex_sort"`
	OptionSort     uint           `gorm:"column:option_sort;type:tinyint(1);not null;" json:"option_sort"`
	TotalScore     uint           `gorm:"column:total_score;type:bigint;comment:1 有序  2 无序;not null;" json:"total_score"` // 1 有序  2 无序
	PassScore      uint           `gorm:"column:pass_score;type:bigint;comment:1 有序  2 无序;not null;" json:"pass_score"`   // 1 有序  2 无序
	Reviewer       string         `gorm:"column:reviewer;type:varchar(100);not null;" json:"reviewer"`
	ExamNotice     string         `gorm:"column:exam_notice;type:varchar(255);not null;" json:"exam_notice"`
	CreatedAt      time.Time      `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"created_at"`
	UpdateAt       time.Time      `gorm:"column:update_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"update_at"`
	DeleteAt       gorm.DeletedAt `gorm:"column:delete_at;type:datetime(3);default:NULL;" json:"delete_at"`
}

func (t *TestPaper) TableName() string {
	return "test_paper"
}
